import requests
import json
import getting
new_id = getting.result
def main(new_id,text):
        
    url = "https://qianfan.baidubce.com/v2/app/conversation/runs"
    
    payload = json.dumps({
        "app_id": "1c43e1f9-ea07-4b93-8cb4-5f899d818cca",
        "query": text,
        "stream": False,
        "conversation_id": new_id
    })
    headers = {
        'Content-Type': 'application/json',
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-ug1c5lUaGpphcjGExbAA5/48862e919cdca89c9fb0109f6619f31188aaaee2'
    }
    
    response = requests.request("POST", url, headers=headers, data=payload)
    
    print(response.text)
    

if __name__ == '__main__':
    while True:
        texting = input('请输入想对话的内容')
        main(new_id,texting)
